<template>
	<view class="main">
		<view class="person-description-information">
			<view class="person-write-input">
				<view class="write-input-text">
					<text>助教简介</text>
					<text>（请填写助教简介）</text>
				</view>
				<view class="write-textarea">
					<textarea v-model="writeTextNumber" name="" id="" cols="30" rows="10"
						placeholder="请介绍一下助教的擅长等"></textarea>
					<view class="text-number">
						<text>{{writeNumber}}</text>
						<text>/200</text>
					</view>
				</view>
			</view>
		</view>
		<view class="assistant-buttons">
			<view class="assistant-buttons-content">
				<button @click="submit">提交反馈</button>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref, watch } from 'vue';

	let writeNumber = ref(0)
	let writeTextNumber = ref('')
	watch(writeTextNumber, textNumber => {
		writeNumber.value = textNumber.split('').length
	})

	// 	提交反馈
	const submit = () => {

	}
</script>

<style lang="scss" scoped>
	.assistant-buttons {
		margin: 0 30rpx;
		margin-top: 54rpx;

		.assistant-buttons-content {
			button {
				background-color: #3377FE;
				color: white;
				border-radius: 100rpx;
				font-size: 28rpx;
				padding: 8rpx 0;

				&::after {
					display: none;
				}
			}
		}
	}

	.main {
		padding: 0 30rpx;
	}

	.person-description-information {
		.person-write-input {
			margin-top: 40rpx;

			.write-input-text {
				text {
					font-size: 28rpx;
					color: #333;

					&:nth-last-child(1) {
						font-size: 24rpx;
						color: #ccc;
					}
				}
			}

			.write-textarea {
				margin-top: 30rpx;
				width: 100%;
				position: relative;

				textarea {
					border-radius: 10rpx;
					flex: 1;
					width: 97%;
					background: #F0F0F0;
					padding-top: 20rpx;
					padding-left: 20rpx;
					font-size: 28rpx;

					&::placeholder {
						color: #999;
					}
				}

				.text-number {
					position: absolute;
					right: 20rpx;
					bottom: 20rpx;

					text {
						font-size: 26rpx;

						&:nth-last-child(1) {
							color: #999999;
						}
					}
				}
			}
		}
	}
</style>